<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateFilesTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('files', function (Blueprint $table) {
            $table->increments('id');
            $table->string('url')->default('')->comment('相对链接');
            $table->string('md5')->default('')->comment('文件MD5');
            $table->string('ext')->default('')->comment('扩展名');
            $table->string('foldpath')->default('')->comment('相对目录');
            $table->string('filesize')->default('')->comment('文件大小');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('files');
    }
}
